/**
 * file
 */
package com.tdkj.action.front.member;

import javax.annotation.Resource;

import com.opensymphony.xwork2.ActionContext;
import com.tdkj.action.BaseAction;
import com.tdkj.model.user.BeanUser;
import com.tdkj.service.user.IBeanUserService;
import com.tdkj.util.PublicConfing;

/**
 * 
 * FileName: MemberCenterAction.java
 * 
 * @Description: TODO 会员中心
 * 
 *               All rights Reserved, Designed By ZTE-ITS
 * 
 *               Copyright: Copyright(C) 2010-2011
 * 
 *               Company 天成科技有限公司
 * 
 * @author: 李兴建
 * 
 * @version V1.0
 * 
 *          Createdate: 2012-5-21 下午08:30:34
 * 
 * 
 * 
 *          Modification History:
 * 
 *          Date Author Version Discription
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 *          
 *          ----------------------------------------------------------------------
 *          -------------
 * 
 *          2012-5-21 李兴建 1.0 1.0
 * 
 *          Why & What is modified: <修改原因描述>
 */
public class MemberCenterAction extends BaseAction {

	private static final long serialVersionUID = -3524543137214087587L;
	private BeanUser user;
	private IBeanUserService userService;
	
	@Resource
	public void setUserService(IBeanUserService userService) {
		this.userService = userService;
	}
	/**
	 * 会员中心页面
	 * 
	 * @return
	 */
	public String memberCenterPage() {
		user = (BeanUser) ActionContext.getContext().getSession().get(PublicConfing.MEMBER_MEMBWE_OBJ_STRING_CONFIG);
		// session过期,到重新登录页面
		if (null == user) {
			return "reLogin";
		}
		user = userService.getUser(user.getId());
		return "memberCenterPage";
	}
	public String getMemberData(){
		user = (BeanUser) ActionContext.getContext().getSession().get(PublicConfing.MEMBER_MEMBWE_OBJ_STRING_CONFIG);
		// session过期,到重新登录页面
		if (null == user) {
			return "reLogin";
		}
		user = userService.getUser(user.getId());
		return "memberFirstPage";
	}

	public BeanUser getUser() {
		return user;
	}

	public void setUser(BeanUser user) {
		this.user = user;
	}
}
